home *** CD-ROM | disk | FTP | other *** search
- /* /// "includes1" */
- #ifndef MAKE_ID
- #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
- #endif
-
- /* Libraries */
- #include <libraries/mui.h>
- #include <libraries/gadtools.h> /* for Barlabel in MenuItem */
- #include <exec/memory.h>
-
- /* Prototypes */
- #include <proto/muimaster.h>
- #include <proto/exec.h>
- #ifdef __GNUC__
- #include <proto/alib.h>
- #else
- #include <clib/alib_protos.h>
- #endif /* __GNUC__ */
- /* /// */
-
- #include <workbench/icon.h>
- #include "GUI.h"
- #include "Hook_utility.h"
- #include "listhooks.h"
-
- extern struct Library *IconBase;
-
- struct Hook DsplHook;
- struct Hook CmpHook;
- struct Hook ConsHook;
- struct Hook DesHook;
-
- struct DiskObject *dobj = 0; /* for AppIcon */
- char *str=0; /* used for string "Arexx Port Name: DIAL.x" in About Win */
-
-
- static struct MUI_CustomClass *LeftRightClass=NULL;
-
- char *STR_LeftRight[3]; /* for LeftRightDispatcher, filled in with Locale strings */
-
- /* /// "Menu definition" */
-
- static struct NewMenu MenuData1[] =
- {
- { NM_TITLE, "Project" , 0 , 0, 0, (APTR)MEN_PROJECT },
- { NM_ITEM, "Load Phonebook","l", 0, 0, (APTR)MEN_LOAD },
- { NM_ITEM, "Save Phonebook","s", 0, 0, (APTR)MEN_SAVE },
- { NM_ITEM, "About..." , 0 , 0, 0, (APTR)MEN_ABOUT },
- { NM_ITEM, "About MUI..." , 0 , 0, 0, (APTR)MEN_ABOUTMUI },
- { NM_ITEM, NM_BARLABEL , 0 , 0, 0, (APTR)0 },
- { NM_ITEM, "Quit" ,"q", 0, 0, (APTR)MEN_QUIT },
-
- { NM_TITLE, "Settings" , 0 , 0, 0, (APTR)MEN_SET },
- { NM_ITEM, "Dial" , 0 , 0, 0, (APTR)MEN_SETTINGS },
- { NM_ITEM, "MUI ..." , 0 , 0, 0, (APTR)MEN_MUISET },
- { NM_ITEM, "Load" , 0 , 0, 0, (APTR)MEN_LOADSET },
- { NM_ITEM, "Save" , 0 , 0, 0, (APTR)MEN_SAVESET },
- { NM_ITEM, "default" , 0 , 0, 0, (APTR)MEN_SETDEFAULT },
-
-
- { NM_END,NULL,0,0,0,(APTR)0 }
- };
- /* /// */
-
-
- /* /// "MUI custom class LeftRightDispatcher" */
-
- struct LeftRightData
- {
- char buf[20];
- };
-
- ULONG LeftRightDispatcher(void)
- {
- register struct IClass *cl __asm("a0");
- register Object *obj __asm("a2");
- register Msg msg __asm("a1");
-
- if (msg->MethodID==MUIM_Numeric_Stringify)
- {
- struct LeftRightData *data = INST_DATA(cl,obj);
- struct MUIP_Numeric_Stringify *m = (APTR)msg;
-
- if (m->value<0)
- sprintf(data->buf,"%s %d",STR_LeftRight[0],m->value*-1);
- else if(m->value==0)
- strcpy(data->buf,STR_LeftRight[2]);
- else
- sprintf(data->buf,"%s %d",STR_LeftRight[1],m->value);
-
- return((ULONG)data->buf);
- }
-
- return(DoSuperMethodA(cl,obj,msg));
- }
- /* /// */
-
- /* /// "GetMBString" */
- static char *GetMBString(APTR ref)
- {
- char *aux;
-
- aux = GetDialString(ref);
- if (aux[1] == '\0') return(&aux[2]);
- else return(aux);
- }
- /* /// */
-
- /* /// "CreateApp" */
- struct ObjApp * CreateApp(int StartIconified)
- {
- int i;
- struct ObjApp * ObjectApp;
-
- char *BaseName;
- APTR GROUP_ROOT_0, GR_Dial, GR_Phonebook, GR_PBbuttons, obj_aux0;
- APTR obj_aux2, obj_aux4, obj_aux5, obj_aux6, GR_AddRem;
- APTR GR_LoadSave, GR_Prefs, GR_Settings, strip;
- APTR GROUP_ROOT_1, A_GR_grp_0, A_GR_grp_1;
-
- STR_LeftRight[0]=GetMBString(MSG_Left),
- STR_LeftRight[1]=GetMBString(MSG_Right),
- STR_LeftRight[2]=GetMBString(MSG_Off),
-
- LeftRightClass=MUI_CreateCustomClass(NULL,MUIC_Slider,NULL,sizeof(struct LeftRightData), LeftRightDispatcher);
- if (!LeftRightClass) return NULL;
-
- if (!(ObjectApp = AllocVec(sizeof(struct ObjApp),MEMF_CLEAR)))
- return(NULL);
-
- ObjectApp->STR_GR_grp_0[0] = GetMBString(MSG_GR_grp_00);
- ObjectApp->STR_GR_grp_0[1] = GetMBString(MSG_GR_grp_01);
- ObjectApp->STR_GR_grp_0[2] = GetMBString(MSG_GR_grp_02);
- ObjectApp->STR_GR_grp_0[3] = NULL;
-
- MenuData1[0].nm_Label=GetMBString(MSG_MEN_PROJECT);
- MenuData1[1].nm_Label=GetMBString(MSG_MEN_LOAD);
- MenuData1[2].nm_Label=GetMBString(MSG_MEN_SAVE);
- MenuData1[3].nm_Label=GetMBString(MSG_MEN_ABOUT);
- MenuData1[4].nm_Label=GetMBString(MSG_MEN_ABOUTMUI);
- /* Barlabel */
- MenuData1[6].nm_Label=GetMBString(MSG_MEN_QUIT);
- MenuData1[7].nm_Label=GetMBString(MSG_MEN_SET);
- MenuData1[8].nm_Label=GetMBString(MSG_MEN_SETTINGS);
- MenuData1[9].nm_Label=GetMBString(MSG_MEN_MUISET);
- MenuData1[10].nm_Label=GetMBString(MSG_MEN_LOADSET);
- MenuData1[11].nm_Label=GetMBString(MSG_MEN_SAVESET);
- MenuData1[12].nm_Label=GetMBString(MSG_MEN_SETDEFAULT);
-
-
- /* --- own --- */
- InstallHook(&DsplHook, list_dsplfunc, NULL);
- InstallHook(&CmpHook, list_cmpfunc, NULL);
- InstallHook(&ConsHook, list_consfunc, NULL);
- InstallHook(&DesHook, list_desfunc, NULL);
- /* ----------- */
-
- ObjectApp->LV_main = ListObject,
- MUIA_Frame, MUIV_Frame_InputList,
- MUIA_List_Format, ",",
- MUIA_List_DisplayHook, &DsplHook,
- MUIA_List_CompareHook, &CmpHook,
- MUIA_List_ConstructHook, &ConsHook,
- MUIA_List_DestructHook, &DesHook,
- MUIA_List_AutoVisible,TRUE,
- MUIA_List_Title,TRUE,
- End;
-
- ObjectApp->LV_main = ListviewObject,
- MUIA_HelpNode, "LV_main",
- MUIA_Listview_DoubleClick, TRUE,
- MUIA_Listview_List, ObjectApp->LV_main,
- MUIA_ShortHelp, GetMBString(MSG_BH_LV_main),
- End;
-
- ObjectApp->BT_Dial = TextObject,
- ButtonFrame,
- MUIA_Weight, 50,
- MUIA_Background, MUII_ButtonBack,
- MUIA_ControlChar, tolower(GetDialString(MSG_BT_Dial)[0]),
- MUIA_Text_Contents, GetMBString(MSG_BT_Dial),
- MUIA_Text_PreParse, "\033c",
- MUIA_Text_HiChar, GetDialString(MSG_BT_Dial)[0],
- MUIA_HelpNode, "BT_Dial",
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- MUIA_ShortHelp, GetMBString(MSG_BH_BT_Dial),
- End;
-
- ObjectApp->CH_Conceal = ImageObject,
- ImageButtonFrame,
- MUIA_InputMode , MUIV_InputMode_Toggle,
- MUIA_Image_Spec , MUII_CheckMark,
- MUIA_Image_FreeVert , TRUE,
- MUIA_Selected , FALSE,\
- MUIA_Background , MUII_ButtonBack,
- MUIA_ShowSelState , FALSE,
- MUIA_ShortHelp, GetMBString(MSG_BH_CH_CONCEAL),
- End;
-
- obj_aux6 = GroupObject,
- MUIA_Group_Columns, 2,
- Child, Label2(GetMBString(MSG_CH_CONCEAL)),
- Child, ObjectApp->CH_Conceal,
- End;
-
- obj_aux5 = GroupObject,
- MUIA_Group_Columns, 2,
- Child, ObjectApp->BT_Dial,
- Child, obj_aux6,
- End;
-
- GR_Dial = GroupObject,
- MUIA_HelpNode, "GR_Dial",
- Child, ObjectApp->LV_main,
- Child, obj_aux5,
- End;
-
- ObjectApp->LV_set = ListObject,
- MUIA_Frame, MUIV_Frame_InputList,
- MUIA_List_Format, ",",
- MUIA_List_DisplayHook, &DsplHook,
- MUIA_List_CompareHook, &CmpHook,
- MUIA_List_ConstructHook, &ConsHook,
- MUIA_List_DestructHook, &DesHook,
- MUIA_List_Title,TRUE,
- MUIA_List_DragSortable,TRUE,
- MUIA_List_AutoVisible,TRUE,
- MUIA_ShortHelp, GetMBString(MSG_BH_LV_set),
- End;
-
- ObjectApp->LV_set = ListviewObject,
- MUIA_HelpNode, "LV_set",
- MUIA_Listview_List, ObjectApp->LV_set,
- MUIA_Listview_DragType, MUIV_Listview_DragType_Immediate,
- End;
-
- ObjectApp->STR_Name = StringObject,
- MUIA_Frame, MUIV_Frame_String,
- MUIA_HelpNode, "STR_Name",
- MUIA_String_AdvanceOnCR, TRUE,
- MUIA_ShortHelp, GetMBString(MSG_BH_STR_Name),
- End;
-
- obj_aux0 = GroupObject,
- MUIA_Group_Columns, 2,
- Child, Label2(GetMBString(MSG_STR_Name)),
- Child, ObjectApp->STR_Name,
- End;
-
- ObjectApp->STR_Number = StringObject,
- MUIA_Frame, MUIV_Frame_String,
- MUIA_HelpNode, "STR_Number",
- MUIA_String_Accept, "0123456789*#!/+-()ABCDEFGHIJKLMNOPQRSTUVWXYZ ",
- MUIA_ShortHelp, GetMBString(MSG_BH_STR_Number),
- End;
-
- obj_aux2 = GroupObject,
- MUIA_Group_Columns, 2,
- Child, Label2(GetMBString(MSG_STR_Number)),
- Child, ObjectApp->STR_Number,
- End;
-
- ObjectApp->BT_Add = TextObject,
- ButtonFrame,
- MUIA_Background, MUII_ButtonBack,
- MUIA_ControlChar, tolower(GetDialString(MSG_BT_Add)[0]),
- MUIA_Text_Contents, GetMBString(MSG_BT_Add),
- MUIA_Text_PreParse, "\033c",
- MUIA_Text_HiChar, GetDialString(MSG_BT_Add)[0],
- MUIA_HelpNode, "BT_Add",
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- MUIA_ShortHelp, GetMBString(MSG_BH_BT_Add),
- End;
-
- ObjectApp->BT_Remove = TextObject,
- ButtonFrame,
- MUIA_Background, MUII_ButtonBack,
- MUIA_ControlChar, tolower(GetDialString(MSG_BT_Remove)[0]),
- MUIA_Text_Contents, GetMBString(MSG_BT_Remove),
- MUIA_Text_PreParse, "\033c",
- MUIA_Text_HiChar, GetDialString(MSG_BT_Remove)[0],
- MUIA_HelpNode, "BT_Remove",
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- MUIA_ShortHelp, GetMBString(MSG_BH_BT_Remove),
- End;
-
- GR_AddRem = GroupObject,
- MUIA_HelpNode, "GR_AddRem",
- MUIA_Group_Horiz, TRUE,
- Child, ObjectApp->BT_Add,
- Child, ObjectApp->BT_Remove,
- End;
-
- ObjectApp->BT_Sort = TextObject,
- ButtonFrame,
- MUIA_Background, MUII_ButtonBack,
- MUIA_ControlChar, tolower(GetDialString(MSG_BT_Sort)[0]),
- MUIA_Text_Contents, GetMBString(MSG_BT_Sort),
- MUIA_Text_PreParse, "\033c",
- MUIA_Text_HiChar, GetDialString(MSG_BT_Sort)[0],
- MUIA_HelpNode, "BT_Sort",
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- MUIA_ShortHelp, GetMBString(MSG_BH_BT_Sort),
- End;
-
- ObjectApp->BT_Load = TextObject,
- ButtonFrame,
- MUIA_Background, MUII_ButtonBack,
- MUIA_ControlChar, tolower(GetDialString(MSG_BT_Load)[0]),
- MUIA_Text_Contents, GetMBString(MSG_BT_Load),
- MUIA_Text_PreParse, "\033c",
- MUIA_Text_HiChar, GetDialString(MSG_BT_Load)[0],
- MUIA_HelpNode, "BT_Load",
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- MUIA_ShortHelp, GetMBString(MSG_BH_BT_Load),
- End;
-
- ObjectApp->BT_Save = TextObject,
- ButtonFrame,
- MUIA_Background, MUII_ButtonBack,
- MUIA_ControlChar, tolower(GetDialString(MSG_BT_Save)[0]),
- MUIA_Text_Contents, GetMBString(MSG_BT_Save),
- MUIA_Text_PreParse, "\033c",
- MUIA_Text_HiChar, GetDialString(MSG_BT_Save)[0],
- MUIA_HelpNode, "BT_Save",
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- MUIA_ShortHelp, GetMBString(MSG_BH_BT_Save),
- End;
-
- GR_LoadSave = GroupObject,
- MUIA_HelpNode, "GR_LoadSave",
- MUIA_Group_Horiz, TRUE,
- Child, ObjectApp->BT_Load,
- Child, ObjectApp->BT_Save,
- End;
-
- GR_PBbuttons = GroupObject,
- MUIA_HelpNode, "GR_PBbuttons",
- MUIA_Group_SameSize, TRUE,
- Child, obj_aux0,
- Child, obj_aux2,
- Child, GR_AddRem,
- Child, HSpace(0),
- Child, ObjectApp->BT_Sort,
- Child, VSpace(0),
- Child, GR_LoadSave,
- End;
-
- GR_Phonebook = GroupObject,
- MUIA_HelpNode, "GR_Phonebook",
- MUIA_Group_Horiz, TRUE,
- Child, ObjectApp->LV_set,
- Child, BalanceObject, End,
- Child, GR_PBbuttons,
- End;
-
- ObjectApp->SL_Length = SliderObject,
- MUIA_HelpNode, "SL_Length",
- MUIA_Frame, MUIV_Frame_Slider,
- MUIA_Slider_Min, 4,
- MUIA_Slider_Max, 100,
- MUIA_Slider_Level, 12,
- MUIA_Weight,50,
- MUIA_Numeric_Format,"%ld0 ms",
- MUIA_ObjectID, 1,
- MUIA_ShortHelp, GetMBString(MSG_BH_SL_Length),
- End;
-
- ObjectApp->SL_Pause = SliderObject,
- MUIA_HelpNode, "SL_Pause",
- MUIA_Frame, MUIV_Frame_Slider,
- MUIA_Slider_Min, 4,
- MUIA_Slider_Max, 100,
- MUIA_Slider_Level, 6,
- MUIA_Numeric_Format,"%ld0 ms",
- MUIA_Weight,50,
- MUIA_ObjectID, 2,
- MUIA_ShortHelp, GetMBString(MSG_BH_SL_Pause),
- End;
-
- ObjectApp->SL_Wait = SliderObject,
- MUIA_HelpNode, "SL_Wait",
- MUIA_Frame, MUIV_Frame_Slider,
- MUIA_Slider_Min, 10,
- MUIA_Slider_Max, 200,
- MUIA_Slider_Level, 60,
- MUIA_Numeric_Format,"%ld0 ms",
- MUIA_Weight,50,
- MUIA_ObjectID, 3,
- MUIA_ShortHelp, GetMBString(MSG_BH_SL_Wait),
- End;
-
- ObjectApp->CH_system = ImageObject,
- ImageButtonFrame,
- MUIA_InputMode , MUIV_InputMode_Toggle,
- MUIA_Image_Spec , MUII_CheckMark,
- MUIA_Image_FreeVert , TRUE,
- MUIA_Selected , FALSE,\
- MUIA_Background , MUII_ButtonBack,
- MUIA_ShowSelState , FALSE,
- MUIA_ObjectID , 9,
- MUIA_ShortHelp, GetMBString(MSG_BH_CH_system),
- End;
-
- obj_aux4 = GroupObject,
- MUIA_Group_Columns, 2,
- Child, Label(GetMBString(MSG_LA_label_7)),
- Child, ObjectApp->CH_system,
- End;
-
- ObjectApp->STR_system = StringObject,
- MUIA_Frame, MUIV_Frame_String,
- MUIA_HelpNode, "STR_system",
- MUIA_String_Accept, "0123456789*#!/-() ",
- MUIA_String_Contents, "0!",
- MUIA_String_MaxLen, 10,
- MUIA_ObjectID, 10,
- MUIA_ShortHelp, GetMBString(MSG_BH_STR_system),
- End;
-
- ObjectApp->STR_DialCode = StringObject,
- MUIA_Frame, MUIV_Frame_String,
- MUIA_HelpNode, "STR_DialCode",
- MUIA_String_Contents, "00",
- MUIA_String_Accept, "0123456789*#!/-() ",
- MUIA_Weight,50,
- MUIA_ObjectID, 5,
- MUIA_ShortHelp, GetMBString(MSG_BH_STR_DialCode),
- End;
-
- ObjectApp->STR_PA_pbname = StringObject,
- MUIA_Frame, MUIV_Frame_String,
- MUIA_String_Contents, "PROGDIR:Phonebook",
- MUIA_String_MaxLen, 80,
- MUIA_ObjectID, 6,
- MUIA_ShortHelp, GetMBString(MSG_BH_STR_PA_pbname),
- End;
-
- ObjectApp->PA_pbname = PopButton(MUII_PopFile);
-
- ObjectApp->PA_pbname = PopaslObject,
- MUIA_HelpNode, "PA_pbname",
- MUIA_Popasl_Type, 0,
- MUIA_Popstring_String, ObjectApp->STR_PA_pbname,
- MUIA_Popstring_Button, ObjectApp->PA_pbname,
- MUIA_Weight,50,
- End;
-
- ObjectApp->SL_AudioLR = NewObject(LeftRightClass->mcc_Class,0,
- MUIA_HelpNode, "SL_AudioLR",
- MUIA_Frame, MUIV_Frame_Slider,
- MUIA_Slider_Min, -64,
- MUIA_Slider_Max, 64,
- MUIA_Slider_Level, -64,
- MUIA_ObjectID, 7,
- MUIA_ShortHelp, GetMBString(MSG_BH_SL_AudioLR),
- TAG_DONE);
-
- GR_Settings = GroupObject,
- MUIA_HelpNode, "GR_Settings",
- MUIA_Group_Columns, 2,
- Child, Label(GetMBString(MSG_LA_label_5)),
- Child, ObjectApp->SL_Length,
- Child, Label(GetMBString(MSG_LA_label_6)),
- Child, ObjectApp->SL_Pause,
- Child, Label(GetMBString(MSG_LA_label_10)),
- Child, ObjectApp->SL_Wait,
- Child, obj_aux4,
- Child, ObjectApp->STR_system,
- Child, Label(GetMBString(MSG_LA_label_8)),
- Child, ObjectApp->STR_DialCode,
- Child, Label(GetMBString(MSG_LA_label_9)),
- Child, ObjectApp->PA_pbname,
- Child, Label(GetMBString(MSG_Label_AudioLR)),
- Child, ObjectApp->SL_AudioLR,
- End;
-
- ObjectApp->BT_PrefSave = TextObject,
- ButtonFrame,
- MUIA_Background, MUII_ButtonBack,
- MUIA_ControlChar, tolower(GetDialString(MSG_BT_PrefSave)[0]),
- MUIA_Text_Contents, GetMBString(MSG_BT_PrefSave),
- MUIA_Text_PreParse, "\033c",
- MUIA_Text_HiChar, GetDialString(MSG_BT_PrefSave)[0],
- MUIA_HelpNode, "BT_PrefSave",
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- MUIA_ShortHelp, GetMBString(MSG_BH_BT_PrefSave),
- End;
-
- GR_Prefs = GroupObject,
- MUIA_HelpNode, "GR_Prefs",
- Child, VSpace(0),
- Child, GR_Settings,
- Child, VSpace(0),
- Child, ObjectApp->BT_PrefSave,
- End;
-
- ObjectApp->GR_grp_0 = RegisterObject,
- MUIA_Register_Titles, ObjectApp->STR_GR_grp_0,
- MUIA_HelpNode, "GR_grp_0",
- Child, GR_Dial,
- Child, GR_Phonebook,
- Child, GR_Prefs,
- End;
-
- GROUP_ROOT_0 = GroupObject,
- Child, ObjectApp->GR_grp_0,
- End;
-
- ObjectApp->window = WindowObject,
- MUIA_Window_Title, "Dial v2.0 © 1999 Andreas Tetzl",
- MUIA_Window_ID, MAKE_ID('D', 'I', 'A', 'L'),
- MUIA_Window_Menustrip, strip = MUI_MakeObject(MUIO_MenustripNM, MenuData1, 0),
- WindowContents, GROUP_ROOT_0,
- End;
-
-
- /* About Window */
- ObjectApp->A_image = ImageObject,
- MUIA_Image_Spec, "5:PROGDIR:Telephone.img",
- MUIA_Frame, MUIV_Frame_ImageButton,
- MUIA_Image_FreeHoriz, TRUE,
- MUIA_Image_FreeVert, TRUE,
- MUIA_FixWidth, 128,
- MUIA_FixHeight, 85,
- MUIA_InputMode, MUIV_InputMode_RelVerify,
- End;
-
- ObjectApp->A_LV_Text = ListObject,
- MUIA_Frame, MUIV_Frame_ReadList,
- MUIA_List_AdjustWidth, TRUE,
- End;
- ObjectApp->A_LV_Text = ListviewObject,
- MUIA_HelpNode, "A_LV_Text",
- MUIA_Listview_Input, FALSE,
- MUIA_Listview_List, ObjectApp->A_LV_Text,
- End;
-
- A_GR_grp_0 = GroupObject,
- MUIA_HelpNode, "A_GR_grp_0",
- MUIA_Group_Columns, 2,
- Child, ObjectApp->A_image,
- Child, ObjectApp->A_LV_Text,
- End;
-
- ObjectApp->A_BT_OK = SimpleButton("OK");
-
- A_GR_grp_1 = GroupObject,
- MUIA_HelpNode, "A_GR_grp_1",
- MUIA_Group_Columns, 3,
- Child, HSpace(0),
- Child, ObjectApp->A_BT_OK,
- Child, HSpace(0),
- End;
-
- GROUP_ROOT_1 = GroupObject,
- Child, A_GR_grp_0,
- Child, A_GR_grp_1,
- End;
-
- ObjectApp->aboutwin = WindowObject,
- MUIA_Window_Title, "Dial",
- MUIA_Window_ID, MAKE_ID('A', 'B', 'O', 'U'),
- MUIA_Window_SizeGadget, FALSE,
- WindowContents, GROUP_ROOT_1,
- End;
-
- /* --------------------- */
-
- /* for MUIA_Application_DiskObject */
- if (IconBase)
- dobj = GetDiskObject("PROGDIR:Dial"),
-
- ObjectApp->App = ApplicationObject,
- MUIA_Application_Author, "Andreas Tetzl",
- MUIA_Application_Base, "Dial",
- MUIA_Application_Title, "Dial",
- MUIA_Application_Version, "$VER: Dial 2.0 (22.9.99)",
- MUIA_Application_Copyright, "Andreas Tetzl",
- MUIA_Application_Description, GetMBString(MSG_AppDescription),
- MUIA_Application_DiskObject, dobj,
- SubWindow, ObjectApp->window,
- End;
-
- if (!ObjectApp->App)
- {
- FreeVec(ObjectApp);
- return(NULL);
- }
-
- DoMethod(ObjectApp->window,
- MUIM_Window_SetCycleChain, ObjectApp->GR_grp_0,
- ObjectApp->LV_main,
- ObjectApp->BT_Dial,
- ObjectApp->CH_Conceal,
- ObjectApp->LV_set,
- ObjectApp->STR_Name,
- ObjectApp->STR_Number,
- ObjectApp->BT_Add,
- ObjectApp->BT_Remove,
- ObjectApp->BT_Sort,
- ObjectApp->BT_Load,
- ObjectApp->BT_Save,
- ObjectApp->SL_Length,
- ObjectApp->SL_Pause,
- ObjectApp->SL_Wait,
- ObjectApp->CH_system,
- ObjectApp->STR_system,
- ObjectApp->STR_DialCode,
- ObjectApp->PA_pbname,
- ObjectApp->SL_AudioLR,
- ObjectApp->BT_PrefSave,
- 0
- );
-
- DoMethod(ObjectApp->aboutwin,
- MUIM_Window_SetCycleChain,
- ObjectApp->A_image,
- ObjectApp->A_LV_Text,
- ObjectApp->A_BT_OK,
- 0
- );
-
- /* --- own --- */
- DoMethod(ObjectApp->window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,
- ObjectApp->App,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
-
- DoMethod(ObjectApp->LV_main,MUIM_Notify,MUIA_Listview_DoubleClick,TRUE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_Dial);
-
- DoMethod(ObjectApp->BT_Dial,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_Dial);
-
- DoMethod(ObjectApp->BT_Add,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_Add);
-
- DoMethod(ObjectApp->BT_Load,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_LoadPB);
-
- DoMethod(ObjectApp->BT_Save,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_SavePB);
-
- DoMethod(ObjectApp->BT_PrefSave,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_Save,MUIV_Application_Save_ENVARC);
-
-
- set(ObjectApp->STR_Name, MUIA_String_AttachedList, ObjectApp->LV_set);
- DoMethod(ObjectApp->STR_Name,MUIM_Notify,MUIA_String_Contents,MUIV_EveryTime,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_Name);
-
- set(ObjectApp->STR_Number, MUIA_String_AttachedList, ObjectApp->LV_set);
- DoMethod(ObjectApp->STR_Number,MUIM_Notify,MUIA_String_Contents,MUIV_EveryTime,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_Number);
-
- DoMethod(ObjectApp->LV_set,MUIM_Notify,MUIA_List_Active,MUIV_EveryTime,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_ListClick);
-
- /* remove active entry from list when BT_Remove is pressed */
- DoMethod(ObjectApp->BT_Remove,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->LV_set,2,MUIM_List_Remove,MUIV_List_Remove_Active);
-
-
- DoMethod(ObjectApp->BT_Sort,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->LV_set,1,MUIM_List_Sort);
-
-
- DoMethod(ObjectApp->BT_Sort,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_PBchanged);
- DoMethod(ObjectApp->BT_Remove,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_PBchanged);
- DoMethod(ObjectApp->BT_Add,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_PBchanged);
-
-
- DoMethod(ObjectApp->GR_grp_0,MUIM_Notify,MUIA_Group_ActivePage,MUIV_Group_ActivePage_First,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_DialPage);
-
- DoMethod(ObjectApp->CH_system ,MUIM_Notify,MUIA_Selected,TRUE,
- ObjectApp->STR_system,3,MUIM_Set,MUIA_Disabled,FALSE);
-
- DoMethod(ObjectApp->CH_system ,MUIM_Notify,MUIA_Selected,FALSE,
- ObjectApp->STR_system,3,MUIM_Set,MUIA_Disabled,TRUE);
-
- DoMethod(ObjectApp->App,MUIM_Notify,MUIA_Application_MenuAction,MEN_SETTINGS,
- ObjectApp->GR_grp_0,3,MUIM_Set,MUIA_Group_ActivePage,MUIV_Group_ActivePage_Last);
-
- DoMethod(ObjectApp->App,MUIM_Notify,MUIA_Application_MenuAction,MEN_MUISET,
- ObjectApp->App,2,MUIM_Application_OpenConfigWindow,0);
-
- DoMethod(ObjectApp->App,MUIM_Notify,MUIA_Application_MenuAction,MEN_LOADSET,
- ObjectApp->App,2,MUIM_Application_Load,MUIV_Application_Load_ENVARC);
-
- DoMethod(ObjectApp->App,MUIM_Notify,MUIA_Application_MenuAction,MEN_SAVESET,
- ObjectApp->App,2,MUIM_Application_Save,MUIV_Application_Save_ENVARC);
-
- DoMethod(ObjectApp->App,MUIM_Notify,MUIA_Application_MenuAction,MEN_SETDEFAULT,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_SETDEFAULT);
-
- /* when the user activates an entry in dial-lisview, activate the same entry in phonebook-list */
- DoMethod(ObjectApp->LV_main,MUIM_Notify,MUIA_List_Active,MUIV_EveryTime,
- ObjectApp->LV_set,3,MUIM_Set,MUIA_List_Active,MUIV_TriggerValue);
-
-
-
- /* Fill in About Listview */
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "\ec\ebDial v2.0\en", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "\ec(22.09.1999)", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "\ecCopyright © 1999 Andreas Tetzl", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, GetMBString(MSG_ABOUT1), MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, GetMBString(MSG_ABOUT2), MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, GetMBString(MSG_ABOUT3), MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "\ecandreas@tetzl.de",MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "\echttp://www.tetzl.de",MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "\ec\ebMUI\en Copyright Stefan Stuntz",MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "\ecAbout Pic & Icon by Jens Borsdorf", MUIV_List_Insert_Bottom);
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, "", MUIV_List_Insert_Bottom);
- get(ObjectApp->App, MUIA_Application_Base, &BaseName);
- str=(char*)malloc(128);
- strcpy(str,"\ecARexx port name: \eb");
- strcat(str,BaseName);
- strcat(str,"\en");
- DoMethod(ObjectApp->A_LV_Text,MUIM_List_InsertSingle, str, MUIV_List_Insert_Bottom);
-
- /* ------- */
- /* send message when user presses image in About window */
- DoMethod(ObjectApp->A_image,MUIM_Notify,MUIA_Pressed,FALSE,
- ObjectApp->App,2,MUIM_Application_ReturnID,ID_ABOUT_IMAGECLICK);
-
- set(ObjectApp->App,MUIA_Application_Iconified, StartIconified);
-
- set(ObjectApp->window,
- MUIA_Window_Open, TRUE
- );
-
-
- return(ObjectApp);
- }
- /* /// */
-
- /* /// "DisposeApp" */
- void DisposeApp(struct ObjApp * ObjectApp)
- {
- MUI_DisposeObject(ObjectApp->App);
- FreeVec(ObjectApp);
- if (LeftRightClass) MUI_DeleteCustomClass(LeftRightClass);
- if (dobj) FreeDiskObject(dobj);
- if (str) free(str);
- }
- /* /// */
-
-